<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class finalcheck extends CI_Controller 
	{
			public function worklist()
			{
			echo  $this->finalcheck_model->getWorklist();
			}
			public function getDataFinalCheck()
			{
			 	$inputData = array(
					"form_id"=>"4",
					//"modify_date"=>$this->input->post("finalcheckFC1"),
					"order"=>$this->input->post("finalcheckFC2"),
					"order_no"=>$this->input->post("finalcheckFC3"),
					"total_pallet"=>$this->input->post("finalcheckFC4"),
					"customer"=>$this->input->post("finalcheckFC5"),
					"product"=>$this->input->post("finalcheckFC6"),
					"numbercar"=>$this->input->post("finalcheckFC7"),
					"grade"=>$this->input->post("finalcheckFC8"),
					//"modify_user"=> '10001',
					//"status"=> '1'
				);
			 	$text = "";
			 	$inputAllData=array();
			 	for($i=10;$i<=16;$i++){
				$data= array();
				$data = array(
			 	"data_name"=> "finalcheckFC".$i,
			 	"data_value"=> $this->input->post("finalcheckFC".$i."_1"),
			 	//"value_end"=> $this->input->post("finalcheckFC".$i."_2")
			 	);
			 	$inputAllData[]=$data;
			 	}
				//print_r($inputAllData);
				print_r( $this->finalcheck_model->keyInFinalCheck($inputData,$inputAllData));
				//echo $this->finalcheck_model->checkFinalCheck($inputData,$inputAllData);

			}
			public function newDataFinalCheck()
			{
			 	$inputData = array(
					"form_id"=>"4",
					//"modify_date"=>$this->input->post("finalcheckFC1"),
					"order"=>$this->input->post("finalcheckFC2"),
					"order_no"=>$this->input->post("finalcheckFC3"),
					"total_pallet"=>$this->input->post("finalcheckFC4"),
					"customer"=>$this->input->post("finalcheckFC5"),
					"product"=>$this->input->post("finalcheckFC6"),
					"numbercar"=>$this->input->post("finalcheckFC7"),
					"grade"=>$this->input->post("finalcheckFC8"),
					"start_date"=>$this->input->post("finalcheckFC10"),
					"end_date"=>$this->input->post("finalcheckFC11"),
					"modify_user"=>$this->session->userdata('user_id'),
					"status"=> '1'
				);
			 	$text = "";
			 	$inputAllData=array();
			 	for($i=10;$i<=16;$i++){
				$data= array();
				$data = array(
			 	"data_name"=> "finalcheckFC".$i,
			 	"value_start"=> $this->input->post("finalcheckFC".$i."_1"),
			 	"value_end"=> $this->input->post("finalcheckFC".$i."_2")
			 	);
			 	$inputAllData[]=$data;
			 	}
				//print_r($inputData);
				echo $this->finalcheck_model->checkFinalCheck($inputData,$inputAllData);

			}
		public function detail_finalcheck()
		{
			$t_id = $this->uri->segment(3);
			$data['rs1']=$this->finalcheck_model->detail_finalcheck1($t_id);
			$data['rs2']=$this->finalcheck_model->detail_finalcheck2($t_id);
			//print_r ($data['rs']);
			$this->load->view('template/template');
			$this->load->view("detail/FinalCheck",$data);
			$this->load->view('template/footer');
		}
		public function information_finalcheck()
		{
			$mt_id = $this->uri->segment(3);
			$data['rs1']=$this->finalcheck_model->information_finalcheck1($mt_id);
			$data['rs2']=$this->finalcheck_model->information_finalcheck2($mt_id);
			//print_r ($data['rs']);
			$this->load->view('template/template');
			$this->load->view("information/FinalCheck",$data);
			$this->load->view('template/footer');
		}
	}
